---
layout: example
categories: example/v1.0.0
version: v1.0.0
title: Load GeoJSON from a URL
description: Loading GeoJSON that contains a simple marker from a URL source.
tags:
  - markers
---
<div id='map'></div>

<script>
var map = L.mapbox.map('map')
    .setView([38.1089, 13.3545], 15)
    .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));

// As with any other AJAX request, this technique is subject to the Same Origin Policy:
// http://en.wikipedia.org/wiki/Same_origin_policy
// So the CSV file must be on the same domain as the Javascript, or the server
// delivering it should support CORS.
var featureLayer = L.mapbox.featureLayer()
    .loadURL('{{site.baseurl}}/assets/data/example-single.geojson')
    .addTo(map);
</script>
